<template>
  <div>
    <input type="text" placeholder="id" v-model="id" />
    <input type="text" placeholder="buildingId" v-model="buildingId" />
    <input type="text" placeholder="name" v-model="name" />
    <input type="text" placeholder="floorCount" v-model="floorCount" />
    <button @click="giveTaFive">giveTaFive</button>
    <button @click="getAllBuilding">getAllBuilding</button>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'Building',
  data() {
    return {
      id: '',
      buildingId: '',
      name: '',
      floorCount: '',
    }
  },
  created() {},
  methods: {
    giveTaFive() {
      axios
        .post('/ibeacon/data/giveyoufive', {
          id: this.id,
          buildingId: this.buildingId,
          name: this.name,
          floorCount: this.floorCount,
        })
        .then(
          (response) => {
            console.log('he receive the five', response.data)
          },
          (error) => {
            console.log('he do not need a five', error)
          }
        )
    },
    getAllBuilding() {
      axios.get('/ibeacon/data/buildings').then(
        (response) => {
          console.log('he receive the five', response.data)
        },
        (error) => {
          console.log('he do not need a five', error)
        }
      )
    },
  },
}
</script>

<style lang="less" scoped></style>
